<template>
	<view>
		<view >
			<view :style="{backgroundImage:'url('+$ftpUrl('/maskGround.png')+')'}"
				style="padding: 20rpx 40rpx; height: 240rpx; width: 690rpx;margin: auto;background-size: cover;background-repeat: no-repeat;">
				<view style="color: #fff;">
					<view >账户余额（元）</view>
					<view class="u-flex u-row-between u-margin-top-60">
						<view>
							<text>￥</text><text class="u-font-weight" style="font-size: 60rpx;">{{user.balance}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view style="width: 700rpx;margin:40rpx auto;">
			<u-section title="提现金额" :right="false" line-color='#4F8BFF'></u-section>
			<view class=" u-margin-top-40" style="padding:0 20rpx; box-shadow: 0px 2px 8px 0px rgba(197,197,197,0.30); ">
				<u-form-item label="金额" :border-bottom ='false'><u-input v-model="form.money" placeholder='请输入提现金额' /></u-form-item>
			</view>
			<view class="u-margin-top-40"></view>
			<u-section title="收款账户" :right="false" line-color='#4F8BFF'></u-section>
			<view  class=" u-margin-top-40" style="padding:0 20rpx;box-shadow: 0px 2px 8px 0px rgba(197,197,197,0.30); ">
				<u-form-item label="姓名" :border-bottom ='false'><u-input v-model="form.name" placeholder='请输入收款姓名' /></u-form-item>
			    <u-form-item label-position='top' label="收款码" :border-bottom ='false' label-width='100'>
					<w-upload  :number='1' v-model="form.qr" ></w-upload>
				</u-form-item>
			</view>
		</view>
		<u-toast ref="uToast" />
		
		<view
		@click="tixian"
			style="
			width: 700rpx;
			margin: auto;
		background: linear-gradient(180deg,#4f8bff , #745eff );
		border-radius: 58px;
		box-shadow: 0px 6px 12px 0px rgba(2,88,255,0.28);padding: 30rpx;margin-top: 20rpx;text-align: center;color: #fff;margin-top: 40rpx;">
			立即提现
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				user:{},
				form:{
					money:"",
					name:"",
					qr:""
				}
			}
		},
		onLoad() {
			this.getUser();
		},
		methods:{
			
			getUser() {
				this.$u.post('/alliance/info').then(res=>{
					this.user = res;
				})
				
				// this.$u.api.userInfo().then(res => {
				// 	this.user = res;
				// })
			},
			tixian(){
				// '/api/alliance/withdraw':'/api/Financial/withdraw'
				if(this.form.name && this.form.name && this.form.qr) return this.$u.toast('参数错误')
				this.$u.post('/alliance/withdraw',this.form).then(res=>{
					this.$refs.uToast.show({
						title: '耐心等待审核',
						type: 'success',
						callback: () => {
							uni.navigateBack({
								
							})
						}
					
					})
				})
			}
	
		}
	}
</script>

<style>
</style>